// components/tab-control/tab-control.js
Component({
  properties: {
    titles: {
      type: Array,
      value: [],
    },
  },
  data: {
    currentIndex: 0,
  },
  methods: {
    onItemTap(e) {
      const currentIndex = e.currentTarget.dataset.index;
      this.setData({
        currentIndex,
      });

      this.triggerEvent("indexChange", currentIndex);
    },
    test() {
      console.log("tab control test function exec");
    },
  },
});
